﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;

namespace ePrice.Models
{
    public class Product
    {
        public int ProductId { get; set; }
        [Required(ErrorMessage="Name is required")]
        public string ProductName { get; set; }
        [Required(ErrorMessage="Code is required")]
        public string ProductCode { get; set; }
        public string ProductFullName { get; set; }
        public string ProductDescription { get; set; }
        public string ProductImageURL { get; set; }
        public string ProductThumbImage { get; set; }
        public int ProductViewedCount { get; set; }
        public int ProductLikedCount { get; set; }
        public int ProductDislikedCount { get; set; }
        public double? ProductReviewerVoteAverage { get; set; }
        public double? ProductUserVoteAverage { get; set; }
        public double ProductPriority { get; set; }
        public DateTime? CreatedTime { get; set; }
        public DateTime? LastModifiedTime { get; set; }
        public int? ManufactureId { get; set; }
        public int CategoryId { get; set; }

        public virtual Category category { get; set; }

        public List<Comment> Comments { get; set; }
    }

    public class Category
    {
        public int CategoryId { get; set; }
        public string CategoryName { get; set; }
        public string CategoryDescription { get; set; }
        public string CategoryImageURL { get; set; }
        public string CategoryThumbImage { get; set; }
        public DateTime? CreatedTime { get; set; }
        public DateTime? LastModifiedTime { get; set; }
        public int ParentId { get; set; }

        public List<Product> Products { get; set; }

    }

    public class Comment
    {
        public int CommentId { get; set; }
        public string CommentTitle { get; set; }
        public string CommentText { get; set; }
        public int CreatorUserId { get; set; }
        public int ProductId { get; set; }

        public Product product { get; set; }
    }
}